package com.intelligent.ispc.client.core.validator;

import com.intelligent.ispc.client.utils.binding.AbstractBean;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Size;

/**
 * Created by simon.liu on 2016/9/19.
 */
public class SysChangePwdDto extends AbstractBean {
    public static final String PROPERTYNAME_OLDPASSWORD = "oldPassword";
    public static final String PROPERTYNAME_NEWPASSWORD = "newPassword";
    public static final String PROPERTYNAME_CONFIRMPASSWORD = "confirmPassword";

    @NotEmpty(message = "Old password must not be empty.", groups = {GroupKeys.class})
    @Size(max = 12, min = 6, message = "Old password length must between 6 to 12.", groups = {GroupKeys.class})
    private String oldPassword;
    @NotEmpty(message = "New password must not be empty.", groups = {GroupKeys.class})
    @Size(max = 12, min = 6, message = "New password length must between 6 to 12.", groups = {GroupKeys.class})
    private String newPassword;
    @NotEmpty(message = "Confirm password must not be empty.", groups = {GroupKeys.class})
    @Size(max = 12, min = 6, message = "Confirm password length must between 6 to 12.", groups = {GroupKeys.class})
    private String confirmPassword;


    public String getOldPassword() {
        return oldPassword;
    }

    public void setOldPassword(String oldPassword) {
        firePropertyChange(PROPERTYNAME_OLDPASSWORD, this.oldPassword, this.oldPassword = oldPassword);
    }

    public String getNewPassword() {
        return newPassword;
    }

    public void setNewPassword(String newPassword) {
        firePropertyChange(PROPERTYNAME_NEWPASSWORD, this.newPassword, this.newPassword = newPassword);
    }

    public String getConfirmPassword() {
        return confirmPassword;
    }

    public void setConfirmPassword(String confirmPassword) {
        firePropertyChange(PROPERTYNAME_CONFIRMPASSWORD, this.confirmPassword, this.confirmPassword = confirmPassword);
    }
}
